import request from '@/utils/request';

export function listAll() {
    return request({
        url: 'sys/role/listAll',
        method: 'get'
    });
}
export function listRole(data) {
    return request({
        url: 'sys/role/list',
        data,
        method: 'post'
    });
}
export function grantRole(data) {
    return request({
        url: 'sys/role/grantRole',
        data,
        method: 'post'
    });
}
export function setMenuIds(data) {
    return request({
        url: 'sys/role/setMenuIds',
        data,
        method: 'post'
    });
}
export function checkRoleName(data) {
    return request({
        url: 'sys/role/checkRoleName',
        data,
        method: 'post'
    });
}
export function checkRoleCode(data) {
    return request({
        url: 'sys/role/checkRoleCode',
        data,
        method: 'post'
    });
}
export function getRoleById(id) {
    return request({
        url: `sys/role/${id}`,
        method: 'get'
    });
}
export function saveRole(data) {
    return request({
        url: `sys/role/save`,
        data,
        method: 'post'
    });
}
export function deleteRole(data) {
    return request({
        url: `sys/role/delete`,
        data,
        method: 'post'
    });
}